# coding=UTF-8
from django.template import Library, Node, TemplateSyntaxError
from django.utils.translation import ugettext as u_

register = Library()

class FavouritesNode(Node):
    def render(self, context):
        from djopping_favs.views import get_favourites
        return get_favourites(context).content

def Favourites(parser, token):
    bits = token.contents.split()
    if len(bits) > 1:
        raise TemplateSyntaxError, u_(u'pavs no recibe argumentos.')
    return FavouritesNode()

render_favourites = register.tag('favs', Favourites)
